package demo8;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/*
@ComponentScan("demo8") 扫描demo8包下的所有类
@Bean("person")
 */
@Configuration
@ComponentScan("demo8")
@Scope("prototype")
public class Config {
    @Bean
    @Scope("prototype")
    public Student initStudent()
    {
        return new Student();
    }
}
